#[derive(Debug, Default, PartialEq, Clone)]
pub struct Item {
    pub title: Option<String>,
    pub username: Option<String>,
    pub password: Option<String>,
    pub url: Option<String>,
    pub notes: Option<String>,
}

impl Item {
    pub fn new(
        title: Option<String>,
        username: Option<String>,
        password: Option<String>,
        url: Option<String>,
        notes: Option<String>,
    ) -> Self {
        Self {
            title,
            username,
            password,
            url,
            notes,
        }
    }

    pub fn push(&mut self, v: &str) {
        if self.title == None {
            self.title = Some(String::from(v));
            return;
        }

        if self.username == None {
            self.username = Some(String::from(v));
            return;
        }

        if self.password == None {
            self.password = Some(String::from(v));
            return;
        }

        if self.url == None {
            self.url = Some(String::from(v));
            return;
        }
        if self.notes == None {
            self.notes = Some(String::from(v));
            return;
        }
    }
}
